Electronic devices in which electronic elements are mounted on a substrate are well known. One example of the types of substrates used in these electronic devices is a substrate that comprises a metal sheet and a frame-shaped wiring substrate formed on the top surface of the metal sheet. An electronic device is then formed by mounting electronic elements on the substrate and then forming a lid over the top surface of the substrate. In this type of electronic device, electronic elements are mounted in recesses formed by the top surface of the metal sheet and the inner walls of the wiring substrate, and the electronic device is electrically connected to an external circuit using electrodes formed on a surface such as the top surface of the wiring substrate (see Japanese Unexamined Patent Application Publication No. 2006-303400).